//
//  SNProductionPlanListModel.m
//  testmodel_test
//
//  Created by stone on 17/1/13.
//  Copyright © 2017年 stone. All rights reserved.
//

#import "SNProductionPlanListModel.h"

@implementation SNProductionPlanListModel


+ (NSDictionary *)objectClassInArray{
    return @{@"result" : [SNProductionPlanListResult class]};
}
@end
@implementation SNProductionPlanListResult
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.fertList = [NSArray array];
        self.landList = [NSArray array];
        self.pestList = [NSArray array];
    }
    return self;
}
- (id)copyWithZone:(nullable NSZone *)zone {
    
    SNProductionPlanListResult * productionPlanListResult = [[SNProductionPlanListResult alloc] init];
    
    productionPlanListResult.fertList = self.fertList.mutableCopy;
    productionPlanListResult.landList = self.landList.mutableCopy;
    productionPlanListResult.pestList = self.pestList.mutableCopy;
    productionPlanListResult.createTime = self.createTime.mutableCopy;
    productionPlanListResult.cropType = self.cropType.mutableCopy;
    productionPlanListResult.custNo = self.custNo.mutableCopy;
    productionPlanListResult.fullName = self.fullName.mutableCopy;
    productionPlanListResult.operatorName = self.operatorName.mutableCopy;
    productionPlanListResult.planName = self.planName.mutableCopy;
    productionPlanListResult.planNo = self.planNo.mutableCopy;
    productionPlanListResult.plantingArea = self.plantingArea.mutableCopy;
    productionPlanListResult.seedBrand = self.seedBrand.mutableCopy;
    productionPlanListResult.seedManu = self.seedManu.mutableCopy;
    productionPlanListResult.seedPerUse = self.seedPerUse.mutableCopy;
    productionPlanListResult.seedPrice = self.seedPrice.mutableCopy;
    productionPlanListResult.seedTotal = self.seedTotal.mutableCopy;
    productionPlanListResult.startTime = self.startTime.mutableCopy;
    productionPlanListResult.status = self.status.mutableCopy;
    productionPlanListResult.year = self.year.mutableCopy;
    productionPlanListResult.fertTotal = self.fertTotal.mutableCopy;
    productionPlanListResult.plantTypes = self.plantTypes.mutableCopy;
    productionPlanListResult.cropTypeName = self.cropTypeName.mutableCopy;
    
    return productionPlanListResult;
}
///** 测试方法 */
//-(NSArray<SNProductionPlanListPestlist *> *)pestList {
//    if (_pestList == nil) {
//        
//        NSMutableArray<SNProductionPlanListPestlist *> * arrM = [NSMutableArray array];
//        for(int i = 0; i < 2; i++) {
//            SNProductionPlanListPestlist * productionPlanListPestlist = [SNProductionPlanListPestlist new];
//            productionPlanListPestlist.ID = @"8137a2d421234ede838efb8f18a636a5";
//            productionPlanListPestlist.pestTotal = @"89";
//            productionPlanListPestlist.pestPerUse = @"2472.222222222222";
//            productionPlanListPestlist.pestTypes = @"你现在";
//            productionPlanListPestlist.pestPrice = @"6999";
//            productionPlanListPestlist.pestManu = @"常常厂家";
//            productionPlanListPestlist.planNo = @"20170112-SCJH10-264774";
//            productionPlanListPestlist.pestBrand = @"图呜呜呜呜";
//            
//            
//            [arrM addObject:productionPlanListPestlist];
//        }
//        _pestList = arrM;
//    }
//    return _pestList;
//}
//
///** 测试方法 */
//-(NSArray<SNProductionPlanListFertlist *> *)fertList{
//    if (_fertList == nil) {
//        NSMutableArray<SNProductionPlanListFertlist *> * arrM = [NSMutableArray array];
//        for(int i = 0; i < 2; i++) {
//            SNProductionPlanListFertlist * productionPlanListFertlist = [SNProductionPlanListFertlist new];
//            productionPlanListFertlist.ID = @"01e5c2c8776e455fa4999334133cc46e";
//            productionPlanListFertlist.fertPerUse = @"1813.01";
//            productionPlanListFertlist.fertContent = @"2";
//            productionPlanListFertlist.fertBrand = @"你现在";
//            productionPlanListFertlist.fertPrice = @"3669";
//            productionPlanListFertlist.planNo = @"220170109-SCJH10-468034";
//            productionPlanListFertlist.fertTypes = @"3";
//            productionPlanListFertlist.fertTotal = @"669";
//            productionPlanListFertlist.fertManu = @"咯喔";
//            
//            [arrM addObject:productionPlanListFertlist];
//        }
//        _fertList = arrM;
//    }
//    
//    return _fertList;
//}
///** 测试方法 */
//-(NSArray<SNProductionPlanListLandList *> *)landList{
//    if (_landList == nil) {
//        NSMutableArray<SNProductionPlanListLandList *> * arrM = [NSMutableArray array];
//        for(int i = 0; i < 4; i++) {
//            SNProductionPlanListLandList * productionPlanListLandList = [SNProductionPlanListLandList new];
//            productionPlanListLandList.ID = @"187f6abf874f4a1489b1d275c708c457";
//            productionPlanListLandList.landNo = @"TD17010909190903";
//            productionPlanListLandList.landType = @"1";
//            productionPlanListLandList.landLocation = @"赵家屯赵家口";
//            productionPlanListLandList.plantArea = @"50";
//            productionPlanListLandList.landAddress = @"230000|黑龙江省;230100|哈尔滨市;230109|松北区;松北村赵家屯";
//            productionPlanListLandList.planNo = @"20170109-SCJH1-808966";
//            productionPlanListLandList.availableArea = @"430";
//            
//            [arrM addObject:productionPlanListLandList];
//        }
//        _landList = arrM;
//    }
//    return _landList;
//}
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"operatorName" : @"operator" };
}
+ (NSDictionary *)objectClassInArray{
    return @{
             @"pestList" : [SNProductionPlanListPestlist class],
             @"fertList" : [SNProductionPlanListFertlist class],
             @"landList" : [SNProductionPlanListLandList class]
             };
}
-(void)setCropType:(NSString *)cropType{
    _cropType = cropType;
    
    switch (cropType.integerValue) {
        case 1:
            _cropTypeName = @"玉米";
            break;
        case 2:
            _cropTypeName = @"大豆";
            break;
        case 3:
            _cropTypeName = @"小麦";
            break;
        case 4:
            _cropTypeName = @"水稻";
            break;
        default:
            break;
    }
}
-(void)setCropTypeName:(NSString *)cropTypeName{
    _cropTypeName = cropTypeName;
    
    if ([@"玉米" isEqualToString:cropTypeName]) {
        _cropType = @"1";
    }else if ([@"大豆" isEqualToString:cropTypeName]) {
        _cropType = @"2";
    }else if ([@"小麦" isEqualToString:cropTypeName]) {
        _cropType = @"3";
    }else if ([@"水稻" isEqualToString:cropTypeName]) {
        _cropType = @"4";
    }
}
@end


@implementation SNProductionPlanListPestlist
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"ID" : @"id" };
}
@end


@implementation SNProductionPlanListFertlist
-(void)setFertContent:(NSString *)fertContent{
    _fertContent = fertContent;
}
/** 肥料种类, 1单体肥2复合肥3掺混肥 ,返回编号 */
-(void)setFertTypes:(NSString *)fertTypes{
    _fertTypes = fertTypes;
    
    switch (fertTypes.integerValue) {
        case 1:
            self.fertTypesName = @"单体肥";
            break;
        case 2:
            self.fertTypesName = @"复合肥";
            break;
        case 3:
            self.fertTypesName = @"掺混肥";
            break;
            
        default:
            break;
    }
}
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"ID" : @"id" };
}
@end

@implementation SNProductionPlanListLandList
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"ID" : @"id" };
}
-(void)setLandType:(NSString *)landType{
    _landType = landType;
    
    switch (landType.integerValue) {
        case 1:
            self.landTypeName = @"旱地";
            break;
        case 2:
            self.landTypeName = @"水田";
            break;
        case 3:
            self.landTypeName = @"水浇地";
            break;
        default:
            break;
    }
    
}
@end

